<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
    <script type="text/javascript">
        function changeCode(){
            alert("123")
            var xmlhttp;
            xmlhttp=new XMLHttpRequest();
            xmlhttp.open("GET","/verifyCode/image",true);
            xmlhttp.responseType = "blob";
            xmlhttp.onload = function(){
                console.log(this);
                if (this.status == 200) {
                    var blob = this.response;
                    var img = document.getElementById("validateCode");
                    img.src = window.URL.createObjectURL(blob);
                }
            }
            xmlhttp.send();
        }
    </script>
</head>
<body>
    <form action="register" method="post">
        用户名:<input type="text" name="username"/><br/>
        密码:<input type="password" name="password"/><br/>
        验证码:<img src="/verifyCode/image" id="validateCode" onclick="changeCode()" /><br/>
        <button>注册</button>
    </form>
</body>
</html>